package com.jh.ios.forecast;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.webkit.WebView;

import org.json.JSONException;
import org.json.JSONObject;

public class GamePlayActivtiy extends Activity {


    private WebView webView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_game_play);

        String url = "https://www.baidu.com";
        String model = getIntent().getStringExtra("model");
        if (model != null){
            try {
                JSONObject jsonObject = new JSONObject(model);
                url = jsonObject.getString("url");
            } catch (JSONException e) {
                e.printStackTrace();
                url = "https://www.baidu.com";
            }
        }
        webView = findViewById(R.id.webView);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setSupportZoom(false);
        webView.loadUrl(url);
    }
}
